package com.ruoyi.web.controller.system;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.Weather;
import com.ruoyi.system.service.IWeatherService;

/**
 * 天气控制器
 */
@RestController
@RequestMapping("/system/weather")
public class WeatherController extends BaseController {
    @Autowired
    private IWeatherService weatherService;

    /**
     * 获取南宁天气数据
     */
    @GetMapping("/current")
    public AjaxResult getWeather() {
        Weather weather = weatherService.getLatestWeather();
        return AjaxResult.success(weather);
    }
} 